<%@ page import="com.chg.mymvc.entity.Item" %>
<%@ page import="java.util.List" %>
<%@ page import="com.chg.mymvc.entity.News" %><%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2020/7/16
  Time: 22:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>完美校园新闻</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css2/news.css">
    <script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<div class="header_fixed">
    <div class="header text_center">
        <span class="back"><img src="<%=request.getContextPath()%>/images2/back.png">返回</span>
        校内新闻
        <span class="close">关闭</span>
    </div>

    <!-- 导航 -->
    <nav>
        <div class="nav_scrollbar text_center">

            <ul>
                <%    List<Item> iteml= (List<Item>) request.getAttribute("itemlist");

                    List<News> newl= (List<News>) request.getAttribute("newslist");
                    if(iteml.size()<1){
                %>

               <li><a href="javascript:void(0);">暂时没有更多新闻</a></li>


                <%}else{ for(Item item:iteml){%>


            <li><a href="front.html?perm=<%=item.getPerm()%>"><%=item.getPerm()%></a></li>


                <%}}%>
            </ul>
        </div>
        <div class="nav_more text_center dn"><img src="<%=request.getContextPath()%>/images2/nav_icon.png"></div>
    </nav>
</div>
<div class="news_list">
    <div class="container">
        <!-- 列表 i -->

        <%if(newl.size()<1){%>
        <div class="news_list_content">
            <div class="news_list_content_left fl">
                <img src="<%=request.getContextPath()%>/images2/14.jpg">
            </div>
            <div class="news_list_content_right fr">
                <h3>暂时没有新闻</h3>
                <!-- <p>11月10日，中国高等教育学会教育信息化分会、河南省教育厅相关领导以及清华大学、北京大学、复旦大学、同济大学等优秀高等学府的学者、教师和企业界代表的广泛参与，大家共聚一堂，......  </p> -->
            </div>
            <div class="date fr">2016-12-23</div>
        </div>
        <%}else{ for(News news:newl){%>

        <a href="frontdetail.html?id=<%=news.getId()%>">      <div class="news_list_content">
            <div class="news_list_content_left fl">
                <img src="<%=request.getContextPath()%>/images2/14.jpg">
            </div>
            <div class="news_list_content_right fr">
                <h3><%=news.getTitle()%></h3>
               <p><%=news.getContent()%> </p>
            </div>
            <div class="date fr"><%=news.getCrtime()%></div>
        </div>
            <a>
      <%}}%>
                <form action="front.html" method="post" id="mainform">
                <a> <div class="load_more text_center" onclick="pageadd()" id="loadbtn">
                    点击加载更多</div></a>
                <input type="text" id="pageaddtext" name="pagenum">
                </form>

          <script>
              var pageinit = 1;

              $("#loadbtn").on('click',function(){
                  $("#pageaddtext").val(pageinit  + 1)
                  $("#mainform").submit();
              })


          </script>
    </div>
</div>

<!-- popup nav -->
<div class="popup_nav dn">
    <!-- <div class="popup_nav_close"></div> -->
    div.a_
    <ul>
        <li>教务处123123</li>
        <li>教务处123</li>
        <li>教务处123123</li>
        <li>教务处123123</li>
        <li>教务处123123</li>
        <li>教务处3</li>
        <li>教务处2</li>
        <li>教务处1</li>
    </ul>
</div>

<!-- 异常页 -->
<div class="load_error text_center dn">
    <img src="images2/error.png">
    <div>宝宝别急哦…… <br/>点击我重新加载吖……</div>
</div>
</body>
<script type="text/javascript" src="<%=request.getContextPath()%>/js2/jquery.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js2/main.js"></script>
</html>
